<template> 
		<web-view :src="webViewUrl" @onPostMessage="onMessage" class="boxWrapper"></web-view> 
</template>

<script> 
import store from "@/store";
import {H5_URL} from '@/config/app';
import {
	toLogin,
	checkLogin
} from '@/libs/login';
export default {
	data() {
		return { 
			webViewUrl:''
		}
	},
	onLoad(options) {
		//小程序向H5传参带在url后面
		if (!store.state.app.token && !checkLogin()) {
			toLogin();
			return false;
		}
		this.webViewUrl = H5_URL+'/#/pages/confirm?id='+options.id+'&token='+store.state.app.token
		console.log(this.webViewUrl);
	},
	onUnload() {
		uni.$emit('callback');
		uni.navigateBack({
			delta:1
		})
	},
	methods:{
		onMessage(e){//接收回调参数
		console.log('data1');
	
		}
	},
} 
</script>

<style scoped>
	/* 覆盖整个页面背景 */
	.boxWrapper {
	  background-color: #151515!important;
	  height: 100vh;
	} 
	
</style>
<style>
	page{
		 background-color: #151515!important;
	}
</style>